-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Dont check for NaTType, just NaT #17564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small change, other lgtm.
@@ -572,7 +572,7 @@ def test_implementation_limits(self): | |||
assert max_td.value == np.iinfo(np.int64).max | |||
|
|||
# Beyond lower limit, a NAT before the Overflow | |||
assert isinstance(min_td - Timedelta(1, 'ns'), NaTType) | |||
assert min_td - Timedelta(1, 'ns') is NaT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use parens
@@ -470,7 +469,7 @@ def encode(obj): | |||
} | |||
|
|||
elif isinstance(obj, (datetime, date, np.datetime64, timedelta, | |||
np.timedelta64, NaTType)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI:
In [40]: np.timedelta64('nat') is pd.NaT
Out[40]: False
In [41]: pd.Timedelta(np.timedelta64('nat')) is pd.NaT
Out[41]: True
this is reason for the complex type checking around NaTs; numpy has a 'nat' like value embedded in np.timedelta64/np.datetime64 (however its not very useful).
lgtm. merge on green. |
Test error is in |
no just rebase |
Codecov Report
@@ Coverage Diff @@
## master #17564 +/- ##
==========================================
- Coverage 91.19% 91.17% -0.02%
==========================================
Files 163 163
Lines 49626 49625 -1
==========================================
- Hits 45258 45248 -10
- Misses 4368 4377 +9
Continue to review full report at Codecov.
|
thanks! |
git diff upstream/master -u -- "*.py" | flake8 --diff